package com.iflysse.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.iflysse.config.ConfigParam;
import com.iflysse.dao.StudentIntelligentDao;
import com.iflysse.dto.StudentIntelligentDto;
import com.iflysse.service.StudentIntelligentService;


@Service
public class StudentIntelligentServiceImpl implements StudentIntelligentService{
	@Autowired
	private StudentIntelligentDao studentIntelligentDao;
	
	@Autowired
	private ConfigParam configParam;
	
	@Override
	public Object getStudentIntelligent(String studentId, Integer pageIndex, Integer pageSize) {
		PageHelper.startPage(pageIndex, pageSize);
		List<StudentIntelligentDto> list = studentIntelligentDao.getStudentIntelligent(studentId, pageIndex, pageSize);		
		// 设置图片路劲
		for(StudentIntelligentDto dto : list) {
			dto.setCourseCover(configParam.getStaticResourcePrefix() + dto.getCourseCover());
		}				
		return list;
	}

}
